package com.example.androidtest.recycleview;

import android.os.Bundle;

import androidx.appcompat.app.AppCompatActivity;
import androidx.recyclerview.widget.LinearLayoutManager;
import androidx.recyclerview.widget.RecyclerView;

import com.example.androidtest.R;

import java.util.ArrayList;
import java.util.List;

public class MainActivity extends AppCompatActivity {
    RecyclerView recyclerView;
    @Override
    protected void onCreate(Bundle savedInstanceState) {
        super.onCreate(savedInstanceState);
        setContentView(R.layout.activity_recycle);
        recyclerView=findViewById(R.id.id_recyclerview);
        List list=new ArrayList<>();
        List list2=new ArrayList<>();
        List list3=new ArrayList<>();
        list.add("123");
        list.add("234");
        list2.add("wonsiko");
        list2.add("khjjkowd");
        list3.add(R.drawable.strawberry);
        list3.add(R.drawable.watermelon);
        HomeAdapter adapter=new HomeAdapter(list,list2, list3,MainActivity.this);
        LinearLayoutManager linearLayoutManager=new LinearLayoutManager(MainActivity.this);
        linearLayoutManager.setOrientation(LinearLayoutManager.VERTICAL);
        recyclerView.setLayoutManager(linearLayoutManager);
        recyclerView.setAdapter(adapter);
    }
}
